package cn.lhl.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;

/**
 * <p>
 * 菜单/资源/权限表
 * </p>
 *
 * @author lhl
 * @since 2023-02-08
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_menu")
/** 资源或权限需要实现GrantedAuthority */
public class SysMenu implements Serializable, GrantedAuthority {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 父级id
	 */
	@TableField("parent_id")
	private Long parentId;

	/**
	 * 菜单名/资源名
	 */
	@TableField("name")
	private String name;

	/**
	 * 菜单/资源 地址
	 */
	@TableField("url")
	private String url;

	/**
	 * 权限唯一标识
	 */
	@TableField("authority")
	private String authority;
}
